Extra nOtes for installation of Chapter 9 applications.

Create two directories like c:\inetPub\wwwroot\WroxFileServer and
c:\inetPub\wwwroot\WroxSoapServer.
Unzip the contents of the file SoapSrv (ASP).zip into
c:\inetPub\wwwroot\WroxSoapServer.
Unzip the contents of the file WroxFileServer (ASP).zip into
c:\inetPub\wwwroot\WroxFileServer.
Create the directory c:\inetPub\wwwroot\WroxFileServer\ProductFiles - which will be empty initially.
Create the directory c:\inetPub\wwwroot\WroxSoapServer\config
Place your SOAPBindings.xml file into the config directory.

Next start IIS Administrator and create a virtual root for
c:\inetPub\wwwroot\WroxSoapServer called WroxSoapServer.
Now create a virtual root for c:\inetpub\wwwroot\WroxFileServer called
WroxFileServer.

Next you edit the global.asa file in the WroxSoapServer/config directory.
You need to change the two lines below:

Application("ConnString") = "DRIVER=SQL Server;SERVER=yourserver;UID=wrox;
PASSWORD=wrox"
Application("XmlServerURL") =   "http://yourserver/WroxFileServer/PutFile.asp"

[These lines are the results of editing on my system. As you can see, I have
created a SQL Server database on my computer am11 and made it the default
database for a user called wrox with a password of wrox.]

If you are using Win2000/COM+ Services, all you have to do is follow the instructions in the ReadMe.txt in the root directory of the download

However, read on if you are using WinNt and MTS...

Unzip all the sample code with the exception of the two ASP zips. Change the project options for all projects that will produce MTS components to produce DLL's that will run unattended. This option can be found on the Project. properties dialog:general tab: Unattended Execution. This checkbox should be checked. This applies to all projects that use ObjectContext objects.

Next open the SoapUtilsMts project.
Go to the SoapUtilsMts.ExecuteRequestWrapper(), where there is a line

Set objX = CreateObject(sProgID).

It must be replaced with

Set objX = oCtx.CreateInstance(sProgID)

Build the projects and ensure that all the references are correct as per the book and that you set Binary compatibility for all DLL projects.

Once all your DLL's are built you must register them with MTS. Open the Transaction Server Explorer and navigate to Console root/Microsoft Transaction Server/Computers/My Computer/Packages Installed. Create a new empty package called xmlStuff. Edit the properties of the package and select the identity tab. Select the Interactive user account so that the package will run under the account of the interactive user. Select the Activation
tab and select the Server Package option. Next go to xmlStuff/Components. Add the following components to the package, oapUtilsMts.Utils, ebProducts.ProdTxUtils, WebProducts.ProductDescriptionTx, WebProducts.SoapWrappers, WroxDataAccess.DataServices and
WroxFileServer.XmlFileUtils. Go to the My Computer folder and select Refresh All Components on the context menu.

Now run the XmlEditorPLus project in the VB debugging environment. You need to create a new product by filling in the various items in the tabbed form. Use the Local.Preview option to ensure that you have a Name,Price,Description and category for your new product. Now test the app by checking that the Local.Save and Local.Open  menu options work as expected.
Finally, with your newly created product opened, select the Web.Save option. If there are any errors, break on the error message box that appears (i.e. hit Ctrl-Break) and look at the various XML messages that are being passed around in the code. One of these will contain useful error information that should point you at the failing component. I used MsgBox's sprinkled liberally through the failing code to detect the failure point. With DLL's marked for Unattended execution, the MsgBox contents will appear in the Event Viewer under the application events section. Before rebuilding the DLL's for debugging, ensure that you stop your web server using the IIS Administrator and you should edit the global.asa file
in each web project. You then must go to the My Computer section in the Transaction Explorer and select Shutdown Server Processes in the context menu. This will make IIS stop those applications and release any DLL's that are loaded into memory. You will then be able to rebuild any required DLL's and register them anew. When you have rebuilt the DLLs, go back to the Transaction Explorer and refresh all components again, then restart the web
server.

